package com.smartcity.result;

import lombok.Data;

@Data
public class ResultData <T> extends ResultBase{


    // 结果数据
    T data;


    public ResultData(ResultEnum resultCode) {
        super(resultCode);
    }

    /**
     * 响应码和msg消息，单个数据，用户返回单个数据对象

     * @param data
     */
    public ResultData( T data) {
        super(ResultEnum.SUCCESS);
        this.data = data;
    }

    //成功返回封装-带数据
    public static <T>  ResultData<T> success(T data) {
        return new ResultData<T>(data);
    }
}
